package com.zhs.gccs.view.taskMap;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.zhs.gccs.R;
import com.zhs.gccs.view.BaseView;

public class MapTipView extends BaseView {
    private TextView tv_compass;
    private TextView tv_zoom;
    private TextView tv_location;

    public MapTipView(@NonNull Context context) {
        super(context);
    }

    public MapTipView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public MapTipView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void init(Context context, AttributeSet attrs, int defStyleAttr) {
        View view = LayoutInflater.from(context).inflate(R.layout.layout_view_mapbox_tips, this, true);
//        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomerLogo);
//        String title = typedArray.getString(R.styleable.CustomerInfoItem_preText);
//        typedArray.recycle();
        tv_compass = view.findViewById(R.id.tv_compass);
        tv_zoom = view.findViewById(R.id.tv_zoom);
        tv_location = view.findViewById(R.id.tv_location);
    }

    public void loadData(int zoom,String address){
        tv_zoom.setText(zoom+"");
        tv_location.setText(address);
    }

    public void setAddress(String address) {
        if(!TextUtils.isEmpty(address)){
            tv_location.setText(address);
        }
    }

    public void setZoom(Integer zoom) {
        tv_zoom.setText(zoom+"");
    }

    public void setCompass(String ompass) {
        if(!TextUtils.isEmpty(ompass)){
            tv_compass.setText(ompass);
        }
    }
}
